package com.listeningframework.boot.domains;

/**
 * 
 * 返回数据对象
 * @author lixining
 * @version $Id: Response.java, v 0.1 2015年4月14日 下午1:54:23 lixining Exp $
 */
public class Response {
    /**
     * 成功
     */
    private static final String SUCCESS = "0";
    /**
     * 失败
     */
    private static final String FAIL    = "1";
    /**
     * 状态
     */
    private String              status;
    /**
     * 描述
     */
    private String              message;
    /**
     * 数据
     */
    private Object              data;

    public Response() {

    }

    public Response(String status, String description) {
        this.status = status;
        this.message = description;
    }

    public Response(String status, String description, Object data) {
        this.status = status;
        this.message = description;
        this.data = data;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static Response fail(String message) {
        return new Response(FAIL, message);
    }

    public static Response success(String message, Object data) {
        return new Response(SUCCESS, message, data);
    }

    public static Response success(String message) {
        return new Response(SUCCESS, message);
    }

}
